/*
 * @Author: 千锋爱佛僧
 * @公众号: 大前端私房菜
 * @Slogan: 千锋精品教程，好学得不像实力派！
 */
/*
 * @Author: 千锋爱佛僧
 * @公众号: 大前端私房菜
 * @Slogan: 千锋精品教程，好学得不像实力派！
 */
import request from "../utils/request";
// 登录
export const userLogin = (account) => {
  return request.post("login", account);
};

// 角色新增
export const rolePost = (roleObj) => {
  return request.post("classes/VueRole", roleObj);
};

// 角色查询
export const roleGet = (roleId) => {
  let query = roleId ? `/${roleId}` : "";
  return request.get(`classes/VueRole${query}`);
};

// 角色修改
export const rolePut = (roleId, roleObj) => {
  return request.put(`classes/VueRole/${roleId}`, roleObj);
};

//删除角色
export const roleDel = (roleId) => {
  return request.delete(`classes/VueRole/${roleId}`);
};

//新增账号（帮别人注册）
export const userReg = (userObj) => {
  return request.post("users", userObj);
};

//加载账号
export const userGet = () => {
  return request.get("users");
};
